// 关于公告的接口
import Mock from "mockjs"


const {data}= Mock.mock({
            'data|4':[
                {
                  
                    'img1':"@image('300x200', '@color()' )",
                    'img2':'https://img0.baidu.com/it/u=586619976,1291278314&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1691082000&t=1b2e9b84caa98abe92c882925504174b',
                    'img3':'https://img0.baidu.com/it/u=1096903239,4278529789&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1691082000&t=8ffbf5a940994135ce2757eefa2e8060',
                    'img4':'https://img0.baidu.com/it/u=3694586360,275772491&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1691082000&t=fc1fce6f567f0571a9fddb85bd923a2b',
                  
                }
            ]
})
Mock.mock('/api/getbanner','post',()=>{
    return {
        data:data,
        msg:'数据获取成功',
        code:200
      
    }
})
Mock.mock('/api/addbanner','post',(config:any)=>{
    const req = JSON.parse(config.body)
    data.push(req)
    return {
        req:req,
        msg:'数据添加成功',
        code:200
    }
})
